home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / pcomm / Source / modem_break.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-12  |  510 b   |  31 lines

  1. /*
  2.  * Send a modem break.  This is an external program to be used in shell
  3.  * scripts.
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include "config.h"
  8.  
  9. #ifdef XENIX_3
  10. #include <sys/types.h>
  11. #include <sys/ioctl.h>
  12. #endif /* XENIX_3 */
  13. #ifdef BSD
  14. #include <sgtty.h>
  15. #else /* BSD */
  16. #include <termio.h>
  17. #endif /* BSD */
  18.  
  19. main()
  20. {
  21.     unsigned int sleep();
  22.  
  23. #ifdef BSD
  24.     ioctl(1, TIOCSBRK, (struct sgttyb *) 0);
  25.     sleep(1);
  26.     return(ioctl(1, TIOCCBRK, (struct sgttyb *) 0));
  27. #else /* BSD */
  28.     return(ioctl(1, TCSBRK, 0));
  29. #endif /* BSD */
  30. }
  31.